//---------------------------------------------------------------------------------
#include "CMario.h"
//---------------------------------------------------------------------------------
static CMario* instance=0;
//---------------------------------------------------------------------------------
CMario* CMario::getInstance(void) {
	if(instance == 0) {
		instance=new CMario();
	}
	
	return instance;
}
//---------------------------------------------------------------------------------
void CMario::draw(QPainter *painter, int x, int y, int step) {
	QImage image=isMoving ? (step < 6 ? image1 : image2) : image3;
	painter->drawImage(QPoint(x, y), sens == tsGauche ? image : image.mirrored(true, false));
}
//---------------------------------------------------------------------------------
CMario::CMario(void) : CSprite() {
	sens=tsGauche;
	isMoving=false;
	image1=QImage(":qt-soko/images/player.png");
	image2=QImage(":qt-soko/images/player2.png");
	image3=QImage(":qt-soko/images/player3.png");
}
//---------------------------------------------------------------------------------